<LayoutTableSmall>
    <!-- 顶部 -->
    <template slot="top"></template>
    <!-- 其他 -->
    <template slot="other"></template>
    <!-- 搜索 -->
    <template slot="search">
        <el-form :inline="true" label-position="left" label-width="80px" :model="mixinTable_tableSearchData"
            @submit.native.prevent class="demo-form-inline">
            <el-form-item>
                <el-input clearable v-model="mixinTable_tableSearchData.couponName" placeholder="优惠券标题"
                    @change="mixinTable_searchData" style="width:200px">
                    <el-button slot="append" icon="el-icon-search" @click="mixinTable_searchData()"></el-button>
                </el-input>
            </el-form-item>
            <el-form-item>
                <el-select style="width: 120px;" v-model="mixinTable_tableSearchData.couponType"
                    @change="mixinTable_searchData" placeholder="优惠券类型" clearable>
                    <el-option label="代金券" value="1"></el-option>
                    <el-option label="折扣券" value="2"></el-option>
                    <el-option label="兑换券" value="3"></el-option>
                </el-select>
            </el-form-item>
            <el-form-item>
                <el-select style="width: 100px;" v-model="mixinTable_tableSearchData.isOpen"
                    @change="mixinTable_searchData" placeholder="过期状态" clearable>
                    <el-option label="未过期" value="1"></el-option>
                    <el-option label="已过期" value="2"></el-option>
                </el-select>
            </el-form-item>
        </el-form>
    </template>
    <!-- 功能 -->
    <template slot="function">
        <el-button type="primary" @click="editBoxOpen({type:'add'})">新建优惠券</el-button>
        <el-button type="primary" plain @click="handOutBoxOpen">发放优惠券</el-button>
    </template>
    <!-- 表格 -->
    <template slot="table">
        <el-table v-loading="mixinTable_loading"  :data="mixinTable_tableData" border style="width: 100%;"
            :ref="mixinPage_vueName+'TableSmall'" height="100%"
            @selection-change="mixinTable_handleSelectionChangeTableSmall">
            <el-table-column type="selection" width="50" align="center"></el-table-column>
            <el-table-column type="index" width="50" :index="mixinTable_indexMethod" align="center" label="#">
            </el-table-column>
            <el-table-column prop="couponName" label="优惠券名称">
            </el-table-column>
            <el-table-column prop="couponDesc" label="券描述">
            </el-table-column>
            <el-table-column prop="couponType" label="优惠券类型">
                <template slot-scope="scope">
                    <div v-show="scope.row.couponType == 1">代金券</div>
                    <div v-show="scope.row.couponType == 2">折扣券</div>
                    <div v-show="scope.row.couponType == 3">兑换券</div>
                </template>
            </el-table-column>
            <el-table-column prop="isOpen" label="状态">
                <template slot-scope="scope">
                    <div v-show="scope.row.isOpen == 1">已开启</div>
                    <div v-show="scope.row.isOpen == 0">关闭</div>
                </template>
            </el-table-column>
            <el-table-column prop="stock" label="库存">
            </el-table-column>
            <el-table-column label="操作" align="center" width="300">
                <template slot-scope="scope">
                    <el-button @click="editBoxOpen({type:'update',id:scope.row.id})">编辑</el-button>
                    <!-- <el-button @click="launch()">投放</el-button> -->

                    <el-button @click="editBoxOpen({ type: 'copy', id: scope.row.id })">
                        复制
                    </el-button>
                    <el-button v-if="scope.row.isOpen===0" type="danger" plain
                        @click="mixinTable_selectTableDeleteData([scope.row])">删除</el-button>
                    <el-dropdown>
                        <el-button plain style="margin-left: 10PX;">更多</el-button>
                        <el-dropdown-menu slot="dropdown">
                            <el-dropdown-item @click.native="toCodeLibrary(scope.row.id)">
                                <el-button type="text">码库</el-button>
                            </el-dropdown-item>
                            <el-dropdown-item @click.native="distribution(scope.row)">
                                <el-button type="text">
                                    <span v-if="scope.row.isOpen == 0">开始发放</span>
                                    <span v-if="scope.row.isOpen == 1">停止发放</span>
                                </el-button>
                            </el-dropdown-item>
                        </el-dropdown-menu>
                    </el-dropdown>

                </template>
            </el-table-column>

        </el-table>

    </template>
    <!-- 表格选项 -->
    <template slot="options">
        <el-button :disabled="mixinTable_selectTableData.length<=0" @click="mixinTable_selectTableDeleteData()">
            批量删除</el-button>
        <el-button :disabled="mixinTable_selectTableData.length<=0"
            @click="mixinTable_clearSelectionChangeTableSmall()">取消选择
        </el-button>
    </template>
    <!-- 分页 -->
    <template slot="page">
        <el-pagination class="paginationStyle" v-if="mixinTable_pageData.total>0" background
            @current-change="mixinTable_pagingData($event)" :current-page="mixinTable_pageData.pageNum"
            :page-size.sync="$vFN.Constants.pageSize" layout="total, prev, pager, next,jumper"
            :total.sync="mixinTable_pageData.total">
        </el-pagination>
    </template>
</LayoutTableSmall>